const express = require('express');
const userCrt = require('../controller/userCrt');
const viewsCrt = require('../controller/viewsCrt');
const childrenRouter = require('./childrenRouter');

// express有提供一个顶级的路由模块。直接使用
const router = express.Router();

// 配置子路由
router.use(childrenRouter)

router.get('/hello', userCrt.hello)
router.post('/login', userCrt.userLogin)
router.post('/register', userCrt.register)


// 使用ejs引擎的方式渲染页面
router.get('/ejsIndex', viewsCrt.index)

module.exports = router